new() operator
wThe keyword new is used to initialise pointers with memory from free store (a section of memory available to all programs).
w
w int *ptr = new int;
w
wIt initialises ptr to point to a memory address of size int (because variables have different sizes, number of bytes, this is necessary). The memory that is pointed to becomes unavailable to other programs. This means that the careful coder will free this memory at the end of its usage.
The pointer can be initialised using free memory. This allows dynamic allocation of array memory. It is most useful for setting up structures called linked lists.